function search_function_fillFilmList(filmList) {


    for(let i=0 ;i<Math.min(filmList.length,search_$movie.length) ; i++){
        let $div = search_$movie.eq(i);
        $div.get(0).style.display="";
        let film = filmList[i];
        $div.find("img").get(0).src=FilmUrl+film._540x488pict;
        $div.find("a").get(0).href=FilmUrl+common_about+"?title="+film.title+"&type="+film.type;
        $div.find("a").get(0).innerHTML=film.title;
        $div.find("p").get(0).innerHTML="<span style='color: #2a58ae'>"+film.location+"&nbsp;&nbsp;</span>"+"<span style='color: red'>"+film.filmSource+"&nbsp;&nbsp;</span>"+"<span style='color: green'>"+film.releaseDate+"&nbsp;&nbsp;</span>";
    }
    for(let i=Math.min(filmList.length,search_$movie.length) ;i<Math.max(filmList.length,search_$movie.length);i++){
        let  div=search_$movie.get(i);
        div.style.display="none";
    }
}

function search_function_addPage(page) {

    search_$FilmAll.get(0).innerHTML=page;
    let pageSize =Math.ceil(page/search_$movie.length);
    search_$PageAll.get(0).innerHTML=pageSize;
    if(pageSize>1){
        let $a = search_$page.find("a");
        let temp=$a.eq(0);
        for(let i=1;i<pageSize;i++){
            let a="<a href='#' name='page' class=\"page-number\">"+(i+1)+"</a>";
            temp.after(a);
            temp=$a.eq(i);
        }
    }
    search_function_clickPage();
}
function search_function_clickPage() {
    search_$page.find("a[name='page']").click(function () {
        this.className="page-number current";
        let not = search_$page.find("a[name='page']").not($(this));
        for(let i=0;i<not.length;i++){
            not.get(i).className="page-number";
        }
        search_function_GetFilmListByPageTitle(this.innerHTML);
        return false;
    })
}
function search_function_GetFilmListByPageTitle(page) {
    $.post(
        FilmUrl+common_searchName+"/GetFilmListByPageTitle",
        {"size":search_$movie.length,
            "page":page,
            "title":search_title_byUrl},
        function (data) {
            let filmList=data["data"];

            search_function_fillFilmList(filmList);
        },
        "json"
    )
    }
